import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login";
import Home from "../views/Home"
import Register from "../views/Register";
import AppIndex from "../views/home/AppIndex";
import forMe from "@/views/library/forMe";

import syrz from "@/views/library/syrz";
import myrz from "../views/library/myrz";
import inde from "../views/admin/inde"
import head from "../views/admin/head";
import side from "../views/admin/side";
import adminuser from "../views/admin/adminxin/adminuser";
import adminRz from "../views/admin/adminxin/adminRz";
import fileup from "../views/fileup"
import demo from "../views/pratice/demo";
import abou from "../views/pratice/abou";
import user from "../views/pratice/user";
import shop from "../views/pratice/shop";
import smslogin from "../views/smslogin";
import center from "../views/home/user/center";
import AllBlogs from "../views/home/blog/AllBlogs";
import WriteBlog from "../views/home/blog/WriteBlog";
import blog from "../views/home/blog/blog";


Vue.use(VueRouter)
const routes = [
  {
    path: '/actice/:id',
    name: 'actice',
    props: true,
    component:()=>import('../views/component/Actice')
  },
  {
    path: '/blog/:id',
    name: 'Blog',
    props: true,
    component: () => import('../views/component/Blog')
  },
  {
    path: '/blog',
    name: '',
    component: blog
  },
  {
   path: '/write',
   name: 'write',
   component: WriteBlog
  },
  {
    path: '/header',
    component:()=>import('../views/common/head')
  },
  {
    path: '/shop',
    name: 'shop',
    component: shop
  },

  {
    path: '/demo',
    component: demo,
    children: [
      {
        path: 'abou',
        component:abou
      },
      {
        path: 'user',
        name: 'user',
        component: user
      },
      {
        path:'',
        name: '',
      }
    ]
  },
  {
    path: '/',
    redirect:'login'
  },
  {
    path: '/smslogin',
    name: 'sms',
    component:smslogin
  },
  {
    path:'/file',
    name: 'file',
    component: fileup
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path:'/home',
    name: 'home',
    component: Home,
    meta: {
    title:'首页'
    },
    children:[
      {
        path:'/index',
        name:'appIndex',
        component:AppIndex
      },
      {
        path: '/profile',
        name: "center",
        component: center
      },
      {
        path: '/news',
        name: 'news',
        component: myrz,
        meta:{
          title:"新闻资讯"
        },
      },
      {
        path: '/talks',
        name: 'talks',
        component: forMe,
        meta:{
        title:'讨论区'
        }
      },

      {
        path: '/niuRen',
        name:'niuRen',
        component: syrz,
        meta:{
        title:'日志广场'
        },
      },
      /*{
        path: '/qwe',
        name: 'd',
        component: side
      }*/
    ],
    /*meta:{
      requiredAuth:true
    }*/
  },
  {
    path: '/register',
    name: 'register',
    component: Register
  },
  {
    path: '/findRz',
    name:'admin',
    component: AllBlogs,
    meta:{
    title:'个人中心',
    }
  },
  {
    path: '/adminrz',
    name: 'asf',
    component: adminRz
  },
  {
    path: '/adminuser',
  }
]
const router=new VueRouter({
  routes,
  mode:'history'
})
export default router
